import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type { AppDispatch, RootState } from '../store'

// TypedUseSelectorHook 可以提高代码维护与可读性减少重复类型注解

export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector // 全局使用useAppSelector
export const useAppDispatch: () => AppDispatch = useDispatch